
package com.tenentia.pcmps.swm.business.implementation;

import java.util.List;

import org.apache.log4j.Logger;

import com.tenentia.pcmps.swm.Constants;
import com.tenentia.pcmps.swm.business.BusinessLogicException;
import com.tenentia.pcmps.swm.business.interfaces.RolesManager;
import com.tenentia.pcmps.swm.data.DataAccessObjectsFactory;
import com.tenentia.pcmps.swm.data.beans.UserRole;
import com.tenentia.pcmps.swm.data.interfaces.RolesDAO;

public class RolesManagerImpl implements RolesManager {
	
	private static final Logger LOGGER = Logger.getLogger(RolesManagerImpl.class.getPackage().getName());

	RolesManagerImpl() {

		super();
	}

	@Override
	public List<UserRole> getAvailableUserRoles() throws BusinessLogicException {

		LOGGER.debug(Constants.STRING_L4J_METHOD_BEGIN);

		try {
			RolesDAO dataAccessObject = (RolesDAO) DataAccessObjectsFactory.getInstance().createNewDataAccessObject(DataAccessObjectsFactory.ROLES_DAO);
			return dataAccessObject.getAvailableUserRoles();
		} catch (Exception e) {
			LOGGER.error(e, e);
			throw new BusinessLogicException(e);
		}
	}

	@Override
	public UserRole getUserRole(Long userID) throws BusinessLogicException {

		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public void setUserRole(Long userID, Long roleID) throws BusinessLogicException {

		// TODO Auto-generated method stub

	}

}
